//index.js
//获取应用实例
const app = getApp();

Page({
  data: {
    detailUrl: '../detail/page/page?id=',
    swiper: [
      { id: '1', img: '../../images/swiper1.jpg', page: true },
      { id: '2', img: '../../images/swiper2.jpg', page: true },
      { id: '3', img: '../../images/swiper3.jpg', page: true }
    ],
    posterImages: [
      '../../images/poster1.jpg',
      '../../images/poster2.jpg',
      '../../images/poster3.jpg'
    ],
    shopTel: app.globalData.shopTel,
    hasTel: true
  },
  onLoad: function () {
  },
  bindPosterTap: function(e) {
    var id = e.currentTarget.id;
    if(id === 'poster0') {
      wx.navigateTo({
        url: this.data.detailUrl + '4',
      })
    }
  },
  callTel: function() {
    var tel = app.globalData.shopTel;
    wx.makePhoneCall({
      phoneNumber: tel
    })
  }
})
